/*
 * @Author: Ygm
 * @Date: 2022-09-18 21:43:24
 * @LastEditors: Ygm
 * @LastEditTime: 2023-02-07 10:33:54
 * @Description: 登录相关接口
 */
import http from "@/http/request.js"

// 获取验证码
const generateSmsCode = (data = {}) => {
	return http.post('/sms/generateSmsCode', data, {
		isloading: true
	})
}


// 校验手机号是否已经注册
const checkSmsCode = (data = {}) => {
	return http.post('/sms/checkSmsCode', data, {
		isloading: true
	})
}

// 注册
const registry = (data = {}) => {
	return http.post('/user/registry', data, {
		isloading: true
	})
}

// 登录
const userLogin = (data = {}) => {
	return http.post('/login/userLogin', data, {
		isloading: true
	})
}

// 退出登录
// const logout = (data = {}) => {
// 	return http.post('/login/logout', data, {
// 		isloading: true
// 	})
// }

// 退出登录
const logout = (data = {}) => {
	return http.post('/auth/token/logout', data, {
		isloading: true
	})
}

// 修改密码
const updateUserPwd = (data = {}) => {
	return http.post('/login/updateUserPwd', data, {
		isloading: true
	})
}

// 密码登录
const loginByPwd = (data = {}) => {
	return http.post('/login/loginByPwd', data, {
		isloading: true
	})
}



export default {
	generateSmsCode,
	registry,
	checkSmsCode,
	logout,
	userLogin,
	loginByPwd,
	updateUserPwd
}
